﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using EntitiesLayer;
using DAL.Repositories;

namespace DAL
{
    public class UnitOfWork
    {
        private static IRepository<Estrella> estrellaRepository;

        public static IRepository<Estrella> EstrellaRepository
        {
            get
            {
                if (estrellaRepository == null)
                    estrellaRepository = new EstrellaRepository();

                return estrellaRepository;
            }
        }

        private static IRepository<Satelite> sateliteRepository;

        public static IRepository<Satelite> SateliteRepository
        {
            get
            {
                if (sateliteRepository == null)
                    sateliteRepository = new SateliteRepository();
                
                return sateliteRepository;
            }
        }

        private static IRepository<CuerpoCeleste> cuerpoCelesteRepository;

        public static IRepository<CuerpoCeleste> CuerpoCelesteRepository
        {
            get
            {
                if (sateliteRepository == null)
                    cuerpoCelesteRepository = new CuerpoCelesteRepository();

                return cuerpoCelesteRepository;
            }
        }
        private static IRepository<Planeta> planetaRepository;

        public static IRepository<Planeta> PlanetaRepository
        {
            get
            {
                if (planetaRepository == null)
                    planetaRepository = new PlanetaRepository();

                return planetaRepository;
            }
        }

        private static IRepository<Mission> missionRepository;
        public static IRepository<Mission> MissionRepository
        {

            get
            {
                if (missionRepository == null)
                    missionRepository = new MissionRepository();
                
                return missionRepository;

            }
        }

        private static IRepository<ProgramaEspacial> programaRepository;
        public static IRepository<ProgramaEspacial> ProgramaRespository {

            get {

                if (programaRepository == null)
                    programaRepository = new ProgramaRepository();
                
                return programaRepository;
            }
        }
    }
}
